package com.tpc.control.jpa;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * ReserveItemSaleId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class ReserveItemSaleId implements java.io.Serializable {

	// Fields

	private String reserveNo;
	private Integer reserveLine;
	private String saleOrder;
	private String saleItem;

	// Constructors

	/** default constructor */
	public ReserveItemSaleId() {
	}

	/** full constructor */
	public ReserveItemSaleId(String reserveNo, Integer reserveLine,
			String saleOrder, String saleItem) {
		this.reserveNo = reserveNo;
		this.reserveLine = reserveLine;
		this.saleOrder = saleOrder;
		this.saleItem = saleItem;
	}

	// Property accessors

	@Column(name = "reserve_no", nullable = false, length = 20)
	public String getReserveNo() {
		return this.reserveNo;
	}

	public void setReserveNo(String reserveNo) {
		this.reserveNo = reserveNo;
	}

	@Column(name = "reserve_line", nullable = false)
	public Integer getReserveLine() {
		return this.reserveLine;
	}

	public void setReserveLine(Integer reserveLine) {
		this.reserveLine = reserveLine;
	}

	@Column(name = "sale_order", nullable = false, length = 20)
	public String getSaleOrder() {
		return this.saleOrder;
	}

	public void setSaleOrder(String saleOrder) {
		this.saleOrder = saleOrder;
	}

	@Column(name = "sale_item", nullable = false, length = 6)
	public String getSaleItem() {
		return this.saleItem;
	}

	public void setSaleItem(String saleItem) {
		this.saleItem = saleItem;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof ReserveItemSaleId))
			return false;
		ReserveItemSaleId castOther = (ReserveItemSaleId) other;

		return ((this.getReserveNo() == castOther.getReserveNo()) || (this
				.getReserveNo() != null
				&& castOther.getReserveNo() != null && this.getReserveNo()
				.equals(castOther.getReserveNo())))
				&& ((this.getReserveLine() == castOther.getReserveLine()) || (this
						.getReserveLine() != null
						&& castOther.getReserveLine() != null && this
						.getReserveLine().equals(castOther.getReserveLine())))
				&& ((this.getSaleOrder() == castOther.getSaleOrder()) || (this
						.getSaleOrder() != null
						&& castOther.getSaleOrder() != null && this
						.getSaleOrder().equals(castOther.getSaleOrder())))
				&& ((this.getSaleItem() == castOther.getSaleItem()) || (this
						.getSaleItem() != null
						&& castOther.getSaleItem() != null && this
						.getSaleItem().equals(castOther.getSaleItem())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getReserveNo() == null ? 0 : this.getReserveNo().hashCode());
		result = 37
				* result
				+ (getReserveLine() == null ? 0 : this.getReserveLine()
						.hashCode());
		result = 37 * result
				+ (getSaleOrder() == null ? 0 : this.getSaleOrder().hashCode());
		result = 37 * result
				+ (getSaleItem() == null ? 0 : this.getSaleItem().hashCode());
		return result;
	}

}